package httpd

type Response struct {
	Code    string      `json:"code"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

const FAIL = "9999"
const SUCCESS = "0000"

func NewResult() *Response {
	return &Response{}
}

func Success() Response {
	return Response{Code: SUCCESS, Data: nil, Message: ""}
}

func OK(message string) Response {
	return Response{Code: SUCCESS, Data: nil, Message: message}
}

func Fail(message string) Response {
	return Response{Code: FAIL, Data: nil, Message: message}
}
